<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <center>
         
            <p:panel header="#{resourcesController.extractResource('ACTIVITY_TRACKING')}" 
                       style="width:680px">
                  
                        
                      <p:lineChart id="category" 
                                   value="#{eventChartBean.categoryModel}" 
                                   legendPosition="e" 
                                   
                                   enhancedLegend="true"
                                   transient="true"
                                   title="#{resourcesController.extractResource('ACTIVITY_DIAGRAM')}" 
                                   minY="0" 
                                   xaxisAngle="-90"
                                   maxY="#{eventChartBean.maxRate}" 
                                   style="height:300px;margin-top:20px;width:650px"/> 
            </p:panel>
            
            <p:panel header="#{resourcesController.extractResource('CURRENT_STATE')}" 
                            style="width:680px" >
                      <h:form>
                          <p:poll update="statistics" interval="1" />  
                          <p:panelGrid columns="2" id="statistics"> 
                                #{resourcesController.extractResource('USERS_CURRENT')}
                                <h:outputText value="#{userSessionListener.currentConnections}"/>
                                #{resourcesController.extractResource('USERS_REGISTERED')}
                                <h:outputText value="#{managementBean.users.size()}"/>
                                #{resourcesController.extractResource('TODAY_OPERATIONS')}
                                <h:outputText value="#{eventChartBean.todaysEventCount}"/>
                                #{resourcesController.extractResource('TODAY_VISITS')}
                                <h:outputText value="#{eventChartBean.todaysUsersCount}"/>
                          </p:panelGrid>
                      </h:form>
            </p:panel>
        </center>
    </h:body>
</html>

